package god;

import java.util.Scanner;

public class J05Ex31CreditCard {
	public static void main(String[] args) {
		
		int cardNum, frontNum1 = 0, frontNum2 = 0;
		String result = "";
		String bank1 = "NH농협카드",bank2 = "신한카드", bank3 = "KB국민카드", bank4 = "비씨카드", bank5 = " 국민은행", bank6 = "외환카드";
		String cardType1 = "35(JCB카드)", cardType2 = "4(비자카드)", cardType3 = "5(마스터 카드)";
		Scanner sc = null;
		
		sc = new Scanner(System.in);
		System.out.println( " 카드번호 6자리를 입력해주세요.");
		cardNum = sc.nextInt();
		
		frontNum1 = (cardNum / 10000);		// 둘째 자리
		frontNum2 = (cardNum / 100000);	// 첫째 자리
		
		if (frontNum1 == 35) {
			switch ( cardNum) {
			case 356317 : result = cardType1 + "    " + bank1; break;
			case 356901 : result = cardType1 + "    " + bank2; break;
			case 356912 : result = cardType1 + "    " + bank3; break;
			case 404825 : result = cardType2 + "    " + bank4; break;
			case 438676 : result = cardType2 + "    " + bank2; break;
			case 457973 : result = cardType2 + "    " + bank5; break;
			case 515594 : result = cardType3 + "    " + bank2; break;
			case 524353 : result = cardType3 + "    " + bank6; break;
			case 540926 : result = cardType3 + "    " + bank5; break;
			default : result = "잘못된 카드 번호입니다";
			}
		}
		else if (frontNum2 == 4) {
			switch ( cardNum) {
			case 356317 : result = cardType1 + "    " + bank1; break;
			case 356901 : result = cardType1 + "    " + bank2; break;
			case 356912 : result = cardType1 + "    " + bank3; break;
			case 404825 : result = cardType2 + "    " + bank4; break;
			case 438676 : result = cardType2 + "    " + bank2; break;
			case 457973 : result = cardType2 + "    " + bank5; break;
			case 515594 : result = cardType3 + "    " + bank2; break;
			case 524353 : result = cardType3 + "    " + bank6; break;
			case 540926 : result = cardType3 + "    " + bank5; break;
			default : result = "잘못된 카드 번호입니다";
			}
		}
		else if (frontNum2 == 5) {
			switch ( cardNum) {
			case 356317 : result = cardType1 + "    " + bank1; break;
			case 356901 : result = cardType1 + "    " + bank2; break;
			case 356912 : result = cardType1 + "    " + bank3; break;
			case 404825 : result = cardType2 + "    " + bank4; break;
			case 438676 : result = cardType2 + "    " + bank2; break;
			case 457973 : result = cardType2 + "    " + bank5; break;
			case 515594 : result = cardType3 + "    " + bank2; break;
			case 524353 : result = cardType3 + "    " + bank6; break;
			case 540926 : result = cardType3 + "    " + bank5; break;
			default : result = "잘못된 카드 번호입니다";
			}
		}
		
		
		
/*		switch ( cardNum) {
		case 356317 : result = cardType1 + "    " + bank1; break;
		case 356901 : result = cardType1 + "    " + bank2; break;
		case 356912 : result = cardType1 + "    " + bank3; break;
		case 404825 : result = cardType2 + "    " + bank4; break;
		case 438676 : result = cardType2 + "    " + bank2; break;
		case 457973 : result = cardType2 + "    " + bank5; break;
		case 515594 : result = cardType3 + "    " + bank2; break;
		case 524353 : result = cardType3 + "    " + bank6; break;
		case 540926 : result = cardType3 + "    " + bank5; break;
		default : result = "잘못된 카드 번호입니다";
		}*/
		
/*		if ( cardNum == 356317) {
			result = cardType1 + "    " + bank1;
		}
		else if ( cardNum == 356901) {
			result = cardType1 + "    " + bank2;
		}
		else if ( cardNum == 356912) {
			result = cardType1 + "    " + bank3;
		}
		else if ( cardNum == 404825) {
			result = cardType2 + "    " + bank4;
		}
		else if ( cardNum == 438676) {
			result = cardType2 + "    " + bank2;
		}
		else if ( cardNum == 457973) {
			result = cardType2 + "    " + bank5;
		}
		else if ( cardNum == 515594) {
			result = cardType3 + "    " + bank2;
		}
		else if ( cardNum == 524353) {
			result = cardType3 + "    " + bank6;
		}
		else if ( cardNum == 540926) {
			result = cardType3 + "    " + bank5;
		}*/
		System.out.println(cardNum);
		// 신용카드번호 각 자리 추출
/*		System.out.println(cardNum / 10);
		System.out.println(cardNum / 100);
		System.out.println(cardNum / 1000);
		System.out.println(cardNum / 10000);
		System.out.println(cardNum / 100000);*/
		System.out.println(result);
		sc.close();
	}
}
